package com.devilvan.betrice.bilibili.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.devilvan.betrice.common.BasePo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Table;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * @author Evad.Wu
 * @Description Bilibili-评论/回复信息表 映射
 * @date 2022-12-23
 */
@Setter
@Getter
@ToString
@NoArgsConstructor
@Accessors(chain = true)
@TableName(value = "BILIBILI_REVIEW")

@Entity
@Table(name = "BILIBILI_REVIEW")
@DynamicInsert
@EntityListeners(AuditingEntityListener.class)
@Schema(description = "Bilibili-评论/回复信息表 映射")
public class BilibiliReviewPo extends BasePo implements Serializable {
    @Serial
    private static final long serialVersionUID = -7474989856428453631L;
    @Schema(description = "AV号")
    @TableField(value = "AID")
    @Column(name = "AID", columnDefinition = "BIGINT(19) NOT NULL COMMENT 'AV号'")
    private Long aid;
    @Schema(description = "评论ID")
    @TableField(value = "RPID")
    @Column(name = "RPID", columnDefinition = "BIGINT(19) NOT NULL COMMENT '评论ID'")
    private Long rpid;
    @Schema(description = "评论时间")
    @TableField(value = "CTIME")
    @Column(name = "CTIME", columnDefinition = "DATETIME NOT NULL COMMENT '评论时间'")
    private Date ctime;
    @Schema(description = "评论用户ID")
    @TableField(value = "MID")
    @Column(name = "MID", columnDefinition = "BIGINT(19) COMMENT '评论用户ID'")
    private Long mid;
    @Schema(description = "评论用户名")
    @TableField(value = "NAME")
    @Column(name = "NAME", columnDefinition = "VARCHAR(64) COMMENT '评论用户名'")
    private String name;
    @Schema(description = "评论内容")
    @TableField(value = "CONTENT")
    @Column(name = "CONTENT", columnDefinition = "TEXT(65,535) COMMENT '评论内容'")
    private String content;
    @Schema(description = "被回复的用户ID")
    @TableField(value = "REPLIED_ID")
    @Column(name = "REPLIED_ID", columnDefinition = "BIGINT(19) COMMENT '被回复的用户ID'")
    private Long repliedId;
    @Schema(description = "被回复的用户名")
    @TableField(value = "REPLIED_NAME")
    @Column(name = "REPLIED_NAME", columnDefinition = "VARCHAR(64) COMMENT '被回复的用户名'")
    private String repliedName;
    @Schema(description = "点赞数")
    @TableField(value = "LIKES")
    @Column(name = "LIKES", columnDefinition = "INT(10) COMMENT '点赞数'")
    private Integer likes;
    @Schema(description = "根评论的ID 0-根评论 其他-根评论的ID")
    @TableField(value = "ROOT")
    @Column(name = "ROOT", columnDefinition = "BIGINT(19) COMMENT '根评论的ID 0-根评论 其他-根评论的ID'")
    private Long root;
    @Schema(description = "回复的评论ID 0-根评论 其他-被回复的评论ID")
    @TableField(value = "PARENT")
    @Column(name = "PARENT", columnDefinition = "BIGINT(19) COMMENT '回复的评论ID 0-根评论 其他-被回复的评论ID'")
    private Long parent;
    @Schema(description = "IP属地")
    @TableField(value = "LOCATION")
    @Column(name = "LOCATION", columnDefinition = "VARCHAR(16) COMMENT 'IP属地'")
    private String location;
}
